<template>
  <div>
    <h2  ref="title">你好厉害呀</h2>
    <button @click="change"  ref="btn">修改</button>
    <banner ref="banner"></banner>
  </div>
</template>

<script>

import Banner from './Banner.vue'
export default {
  components: {
    Banner
  },
  data() {
    return {
      title: '我还是标题',
      counter: 0,
    }
  },
  methods: {
    increment() {
      this.counter++
    },
    decrement() {
      this.counter--
    },
    change(){
      console.log(this.$refs.btn)
      console.log(this.$refs.title)
      console.log(this.$refs.banner)
      console.log(this.$refs.banner.$el)
      this.$refs.banner.bannerClcik()
    }
  },
}
</script>

<style scoped>
h2 {
  color: red;
}
</style>
